package com.bruce.codeFactory.Thread;

/**
 * @author luotuan
 * @Description
 * @create 2019-02-23 10:18
 **/
public class Novisibility {
    private static boolean ready;
    private static int number;
    private static class ReaderThread extends Thread{
        @Override
        public void run() {
            while (!ready){
                Thread.yield();
            }
            System.out.println("--------->"+number);
        }
    }

    public static void main(String[] args) {
        new ReaderThread().start();
        number = 11;
        ready = true;
    }
}
